(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  ["pages/user/order/order"], {
    "197a": function (t, e, r) {
      "use strict";
      var n = r("34bd"),
        a = r.n(n);
      a.a
    },
    "31eb": function (t, e, r) {
      "use strict";
      r.r(e);
      var n = r("dbae"),
        a = r("4166");
      for (var o in a) "default" !== o && function (t) {
        r.d(e, t, (function () {
          return a[t]
        }))
      }(o);
      r("197a");
      var i, s = r("f0c5"),
        d = Object(s["a"])(a["default"], n["b"], n["c"], !1, null, null, null, !1, n["a"], i);
      e["default"] = d.exports
    },
    "34bd": function (t, e, r) {},
    4166: function (t, e, r) {
      "use strict";
      r.r(e);
      var n = r("9105"),
        a = r.n(n);
      for (var o in n) "default" !== o && function (t) {
        r.d(e, t, (function () {
          return n[t]
        }))
      }(o);
      e["default"] = a.a
    },
    9045: function (t, e, r) {
      "use strict";
      (function (t) {
        r("77a0");
        n(r("66fd"));
        var e = n(r("31eb"));

        function n(t) {
          return t && t.__esModule ? t : {
            default: t
          }
        }
        t(e.default)
      }).call(this, r("543d")["createPage"])
    },
    9105: function (t, e, r) {
      "use strict";
      (function (t) {
        Object.defineProperty(e, "__esModule", {
          value: !0
        }), e.default = void 0;
        var n = a(r("a34a"));

        function a(t) {
          return t && t.__esModule ? t : {
            default: t
          }
        }

        function o(t, e, r, n, a, o, i) {
          try {
            var s = t[o](i),
              d = s.value
          } catch (u) {
            return void r(u)
          }
          s.done ? e(d) : Promise.resolve(d).then(n, a)
        }

        function i(t) {
          return function () {
            var e = this,
              r = arguments;
            return new Promise((function (n, a) {
              var i = t.apply(e, r);

              function s(t) {
                o(i, n, a, s, d, "next", t)
              }

              function d(t) {
                o(i, n, a, s, d, "throw", t)
              }
              s(void 0)
            }))
          }
        }
        var s = {
          data: function () {
            return {
              tabCurrentIndex: 0,
              navList: [{
                state: 0,
                text: "全部",
                loadingType: "more",
                current_page: 1,
                orderList: []
              }, {
                state: 1,
                text: "待支付",
                loadingType: "more",
                current_page: 1,
                orderList: []
              }, {
                state: 2,
                text: "待消费",
                loadingType: "more",
                current_page: 1,
                orderList: []
              }, {
                state: 3,
                text: "待确认",
                loadingType: "more",
                current_page: 1,
                orderList: []
              }, {
                state: 4,
                text: "待评论",
                loadingType: "more",
                current_page: 1,
                orderList: []
              }],
              contentText: {
                contentdown: " ",
                contentrefresh: "正在加载...",
                contentnomore: ""
              }
            }
          },
          onLoad: function (t) {
            t.state || (t.state = 0), this.tabCurrentIndex = +t.state, 0 == t.state && this.loadData()
          },
          methods: {
            loadData: function (t) {
              var e = this,
                r = this.tabCurrentIndex,
                n = this.navList[r],
                a = n.state;
              "noMore" != n.loadingType && ("tabChange" === t && !0 === n.loaded || "loading" !== n.loadingType && (n.loadingType = "loading", this.$api.get({
                url: "/wanlshop/order/getOrderList",
                data: {
                  state: a,
                  page: n.current_page
                },
                success: function (t) {
                  n.current_page = t.current_page, t.last_page === t.current_page ? n.loadingType = "noMore" : (n.loadingType = "more", n.current_page++);
                  var r = t.data.filter((function (t) {
                    return t = Object.assign(t, e.orderStateExp(t.state)), 0 === a ? t : t.state === a
                  }));
                  r.forEach((function (t) {
                    n.orderList.push(t)
                  })), e.$set(n, "loaded", !0)
                }
              })))
            },
            changeTab: function (t) {
              this.tabCurrentIndex = t.target.current, this.loadData("tabChange")
            },
            tabClick: function (t) {
              this.tabCurrentIndex = t
            },
            deleteOrder: function (e, r) {
              var n = this;
              t.showLoading({
                title: "请稍后"
              }), this.$api.post({
                url: "/wanlshop/order/delOrder",
                data: {
                  id: e
                },
                success: function (e) {
                  n.navList[n.tabCurrentIndex].orderList.splice(r, 1), t.hideLoading()
                }
              })
            },
            cancelOrder: function (e) {
              var r = this;
              t.showLoading({
                title: "请稍后"
              }), this.$api.post({
                url: "/wanlshop/order/cancelOrder",
                data: {
                  id: e.id
                },
                success: function (n) {
                  var a = r.orderStateExp(7),
                    o = a.stateTip,
                    i = a.stateTipColor;
                  e = Object.assign(e, {
                    state: 7,
                    stateTip: o,
                    stateTipColor: i
                  }), r.$store.commit("statistics/order", {
                    pay: r.$store.state.statistics.order.pay - 1
                  });
                  var s = r.navList[1].orderList,
                    d = s.findIndex((function (t) {
                      return t.id === e.id
                    })); - 1 !== d && s.splice(d, 1), t.hideLoading()
                }
              })
            },
            commentOrder: function (t) {
              this.$wanlshop.to("/pages/user/order/comment?order_id=" + t)
            },
            paymentOrder: function (t) {
              this.$wanlshop.to("/pages/user/money/pay?order_id=" + t)
            },
            confirmOrder: function (e) {
              var r = this;
              t.showLoading({
                title: "请稍后"
              }), this.$api.post({
                url: "/wanlshop/order/confirmOrder",
                data: {
                  id: e.id
                },
                success: function (n) {
                  var a = r.orderStateExp(4),
                    o = a.stateTip,
                    i = a.stateTipColor;
                  e = Object.assign(e, {
                    state: 4,
                    stateTip: o,
                    stateTipColor: i
                  }), r.$store.commit("statistics/order", {
                    receiving: r.$store.state.statistics.order.receiving - 1,
                    evaluate: r.$store.state.statistics.order.evaluate + 1
                  }), t.hideLoading()
                }
              })
            },
            orderStateExp: function (t) {
              var e = "",
                r = "#ff5000";
              switch (+t) {
                case 1:
                  e = "等待支付";
                  break;
                case 2:
                  e = "等待消费";
                  break;
                case 3:
                  // e = "卖家已发货";
                  e = "已消费待确认";
                  break;
                case 4:
                  e = "交易成功";
                  break;
                case 5:
                  e = "交易成功";
                  break;
                case 6:
                  e = "已完成";
                  break;
                case 7:
                  e = "订单已关闭", r = "#909399";
                  break
              }
              return {
                stateTip: e,
                stateTipColor: r
              }
            },
            getRefund: function (t) {
              return ["退款", "退款中", "待退货", "退款完成", "退款关闭", "退款被拒"][t]
            },
            editAddress: function (t) {
              this.$wanlshop.to("/pages/user/address/address?source=2&order_id=" + t)
            },
            refreshList: function (e, r) {
              var a = this;
              return i(n.default.mark((function o() {
                return n.default.wrap((function (n) {
                  while (1) switch (n.prev = n.next) {
                    case 0:
                      t.showLoading({
                        title: "正在提交新地址"
                      }), a.$api.post({
                        url: "/wanlshop/order/editOrderAddress",
                        data: {
                          id: r,
                          address_id: e
                        },
                        success: function (e) {
                          a.$wanlshop.msg("地址修改成功"), t.hideLoading()
                        }
                      });
                    case 2:
                    case "end":
                      return n.stop()
                  }
                }), o)
              })))()
            }
          }
        };
        e.default = s
      }).call(this, r("543d")["default"])
    },
    dbae: function (t, e, r) {
      "use strict";
      r.d(e, "b", (function () {
        return a
      })), r.d(e, "c", (function () {
        return o
      })), r.d(e, "a", (function () {
        return n
      }));
      var n = {
          wanlEmpty: function () {
            return r.e("components/wanl-empty/wanl-empty").then(r.bind(null, "13bf"))
          },
          uniLoadMore: function () {
            return r.e("components/uni-load-more/uni-load-more").then(r.bind(null, "ac38"))
          }
        },
        a = function () {
          var t = this,
            e = t.$createElement,
            r = (t._self._c, t.__map(t.navList, (function (e, r) {
              var n = t.__get_orig(e),
                a = t.__map(e.orderList, (function (e, r) {
                  var n = t.__get_orig(e),
                    a = t.__map(e.goods, (function (e, r) {
                      var n = t.__get_orig(e),
                        a = t.$wanlshop.oss(e.image, 70, 70),
                        o = 0 != e.refund_status ? t.getRefund(e.refund_status) : null;
                      return {
                        $orig: n,
                        g0: a,
                        m0: o
                      }
                    }));
                  return {
                    $orig: n,
                    l0: a
                  }
                }));
              return {
                $orig: n,
                l1: a
              }
            })));
          t.$mp.data = Object.assign({}, {
            $root: {
              l2: r
            }
          })
        },
        o = []
    }
  },
  [
    ["9045", "common/runtime", "common/vendor"]
  ]
]);